$(function () {
    var e = "pop-in";
    mui("body").on("tap", "a", function () {
        var i = this.getAttribute("href"), t = this.href;
        mui.openWindow({id: i, url: t, styles: {popGesture: "close"}, show: {aniShow: e}, waiting: {autoShow: !0}})
    });
    var i = function (e) {
        if (1 == e.code) {
            if (e.bannerList && e.bannerList.length) {
                var i = e.bannerList, t = $(".mui-slider .mui-slider-group"), a = $(".mui-slider .mui-slider-indicator");
                if (t.empty(), a.empty(), i[0].PIC_PATH = "http://www.dcloud.io/hellomui/images/cbd.jpg", 1 == i.length)t.append('<div class="mui-slider-item"><a href="' + (i[0].IS_LINK ? i[0].LINK_URL : "#") + '"><img src="' + (i[0].PIC_PATH || "") + '"></a></div>'); else {
                    t.append('<div class="mui-slider-item mui-slider-item-duplicate"><a href="' + (i[i.length - 1].IS_LINK ? i[i.length - 1].LINK_URL : "#") + '"><img src="' + (i[i.length - 1].PIC_PATH || "") + '"></a></div>');
                    for (var s = 0; s < i.length; s++)t.append('<div class="mui-slider-item"><a href="' + (i[s].IS_LINK ? i[s].LINK_URL : "#") + '"><img src="' + (i[s].PIC_PATH || "") + '"></a></div>'), a.append('<div class="mui-indicator ' + (0 === s ? "mui-active" : "") + '"></div>');
                    t.append('<div class="mui-slider-item mui-slider-item-duplicate"><a href="' + (i[0].IS_LINK ? i[0].LINK_URL : "#") + '"><img src="' + (i[0].PIC_PATH || "") + '"></a></div>');
                    var n = mui(".mui-slider");
                    n.slider({interval: 5e3})
                }
            }
        } else mui.toast(e.message)
    }, t = function (e) {
        1 == e.code ? $("#top-news").text(e.title).parent("a").attr("href", "news/news-details.html?newsId=" + e.newsId) : mui.toast(e.message)
    }, a = new common, s = {
        url: a.hostUrl + "mobileappbanner/findBannerInfo.do",
        data: {FKEY: a.getKey("bannerList")},
        success: i
    };
    s = $.extend({}, a.ajaxOption, s), $.ajax(s);
    var n = {url: a.hostUrl + "mobileappnews/topNews.do", data: {FKEY: a.getKey("topNews")}, success: t};
    n = $.extend({}, a.ajaxOption, n), $.ajax(n)
});